package com.atguigu.edu.publisher.mapper;

import com.atguigu.edu.publisher.beans.TrafficKeywordsBean;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

public interface KeywordRateMapper {
    @Select("select keyword,sum(keyword_rate) keyword_score\n" +
            "from dws_traffic_source_keyword_page_view_window\n" +
            "where toYYYYMMDD(stt) = #{date}\n" +
            "group by toYYYYMMDD(stt),keyword\n" +
            "order by keyword_score desc;")
    List<TrafficKeywordsBean> selectKeyWords(@RequestParam(value = "date",defaultValue = "0") Integer date);
}
